searchengine: Populate filesystem model in an idle
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 7 Mar 2023 21:35:47 +0000 (22:35 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 8 Mar 2023 10:32:44 +0000 (11:32 +0100)
commitde4725dbd5301658537c279e7a4cb3026905b1f5
tree7797eccf85da7b97b75362a87a5fe06c9c79028c
parent64697ea95b847749d0e21dfa16ef43dee2564844
searchengine: Populate filesystem model in an idle

When starting a search over a very populated filesystem, it
is possible that typing the first chars will return a too
high number of results. Even though iterating through the
cursor is in itself very fast, extracting the GIO information
from those many files at once is not going to be as fast.

In order to increase interactivity (i.e. not make things
possibly sluggish) iterate the cursor in an idle function
and add search results to the filechooser model little by little.

If the user keeps typing (as it is likely will happen), there
will be better chances to cancel and proceed to the next
query timely. If not, the results will be there soon enough.
gtk/gtksearchenginetracker3.c